Message Format

Field types

Messages and packets can be viewed as a finite collection of fields. The list of valid field types is presented below.

Name Size Description
int8_t 1 8 bit signed integer.
uint8_t 1 8 bit unsigned integer.
int16_t 2 16 bit signed integer.
uint16_t 2 16 bit unsigned integer.
int32_t 4 32 bit signed integer.
uint32_t 4 32 bit unsigned integer.
int64_t 8 A 64 bit signed integer
fp32_t 4 32 bit single precision floating point number in IEEE 754 format.
fp64_t 8 64 bit double precision floating point number in IEEE 754 format.
rawdata n/a Variable length byte stream.
plaintext n/a Variable length ASCII character stream.
message n/a An inline message. Useful for encapsulating other messages.
message-list n/a A list of messages.

Serialization

To ensure accurate transportation some field types may require special treatment on transmission and reception. The operation of preparing a field type for transmission is called serialization, the inverse action is called deserialization. No special serialization is required for types that are not described in the table below, their values should be used as is.

Name Serialization
rawdata A sequence of type rawdata is serialized by prepending a value of type uint16_t, representing the length of the sequence, to the stream of bytes. On deserialization the prepended value is used to retrieve the correct size of data bytes. The rawdata type length is limited only by the communication protocol in use.
plaintext A sequence of type plaintext is serialized by prepending a value of type uint16_t, representing the length of the sequence, to the stream of ASCII characters. On deserialization the prepended value is used to retrieve the correct ASCII character sequence size. The plaintext type length is limited only by the communication protocol in use.
message A field of type message is serialized by prepending a value of type uint16_t, representing the identification number of the message, to the serialized message payload. The special identification number 65535 must be used when no message is present. On deserialization the prepended value is used to retrieve the correct message identification number. The message type length is limited only by the communication protocol in use.
message-list A field of type message-list is serialized by prepending a value of type uint16_t, representing the number of messages in the list, to the serialized message payload. On deserialization the prepended value is used to retrieve the correct number of messages

Reference of Units

The following table lists the units used in the subsequent chapters.

Abbreviation Name
A Ampere
bit Bit
bps Bits per second
byte Byte
g Gravity acceleration
dB Decibel
dB/m Decibel per meter
dBHz Decibel hertz
° Degree
°C Degree Celsius
G Gauss
hPa Hectopascal
Hz Hertz
kg/m/m/m Kilogram per cubic metre
MiB Mebibyte
m Meter
m/s Meter per second
m/s/s Meter per second^2
ms Millisecond
S/m Siemens per meter
Nm Newton meter
N Newton
Pa Pascal
% Percent
PSU Pratical Salinity Unit
rad Radian
rad/s Radian per second
rpm Revolutions per minute
rpm/s Revolutions per minute per second
s Second
V Volt
Enumerated Enumeration of integer values
List Comma separated list of values
Bitfield Bit field
TupleList List of key/value tuples